package com.intelligentclass.entity;

import jakarta.persistence.*;
import com.intelligentclass.entity.Teaching;
import java.util.List;

@Entity
public class Student {

    @Id
    private String sno;

    private String sname;
    private String password;

    @ManyToMany
    @JoinTable(
            name = "sc",
            joinColumns = @JoinColumn(name = "sno"),
            inverseJoinColumns = @JoinColumn(name = "cid")
    )
    private List<Teaching> courseList;

    public Student(){}

    public Student(String sno, String sname, String password) {
        this.sno = sno;
        this.sname = sname;
        this.password = password;
    }

    public List<Teaching> getCourseList() {
        return courseList;
    }
    public void setCourseList(List<Teaching> courseList) {
        this.courseList = courseList;
    }
    public String getSno() {
        return sno;
    }
    public void setSno(String sno) {
        this.sno = sno;
    }
    public String getSname() {
        return sname;
    }
    public void setSname(String sname) {
        this.sname = sname;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
}
